package com.itheima;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Student implements Comparable<Student> {
    private String name;
    private int age;


    @Override
    public int compareTo(Student o) {
        //按照学生的年龄降序
        return o.getAge() - this.getAge();
    }

}
